<template>
  <div class="box">
    <p>发给child的modelMSG: {{modelMSG}}</p>
    <p>
      修改modelMSG:
      <input type="text" v-model="modelMSG" />
    </p>
    <Child :msg.sync="modelMSG" />
    <!-- //这里:data.sync其实就是 :data="modelMSG" @update:data="(value) => { this.data = value }" -->
  </div>
</template>

<script>
import Child from "./Child";
export default {
  name: "Parent",
  components: {
    Child
  },
  data() {
    return {
      modelMSG: "发给Child的modelMSG信息",
      name: "Parent的名字"
    };
  }
};
</script>